﻿using System;
using System.Collections.Generic;
using JetBrains.Annotations;
using Missbot.Core.Cache;
using Missbot.Core.Scheduler;
using Missbot.Model.MsgCmds.Account;
using Missbot.Model.MsgCmds.Notification;

namespace Missbot.AIModule.Schedulers.ClearUnread
{
    [UsedImplicitly]
    public class ClearUnreadScheduler : IScheduler
    {
        public override bool Enabled => false;

        protected override List<ScheduleMeta> ModelList { get; set; }
            = new()
            {
                  new ScheduleMeta
                  {
                      IsImmediately = true,
                      Span = new IntervalSpan
                             {
                                 Interval = TimeSpan.FromMinutes(10)
                             }
                  }
              };
        
        public override string Owner => "iceai";

        protected override void ScheduleDo(SchedulerTimer timer)
        {
            MsgSender.PushMsg(new ReadAllMessagesCmd());
            MsgSender.PushMsg(new ReadAllUnreadNotesCmd());
            MsgSender.PushMsg(new MarkAllAsReadCmd());
        }
    }
}